﻿/*
 * content js, which will be add to every page
**/

(function() {

function bg_log(level, log) {
	chrome.extension.sendRequest(
		{
			"cmd": "log",
			"level": level,
			"data": log
		}, 
		function(response) {}
	);
}

// some log can't write in the page because the page maybe reload or jump over
(function() {
	// bg_log("debug", "load content.js");
})();

/*
 * add by rabbithan at 20120821
 * auto jump in Tencent
**/
(function() {
var form = document.getElementById("Form1");
if (form && form.action) {
	var action = form.action;
	if (action.indexOf("tencentrawurl=")) {
		document.getElementById("btnVisit30").click();
		bg_log("auto jump to %s", action);
	}
}
})();

})();
